#include("/template/common/layout/_page_layout.html")
#@layout()

#define css()
<style type="text/css">
</style>
#end

#define content()

<br>
<fieldset class="layui-elem-field layui-field-title" style="margin-top:30px;color: #009688;">
    <legend style="font-size: 20px;font-weight: 500;">风险跟踪管理登记</legend>
</fieldset>
<div class="layui-row">
    <table id="dateTable" lay-filter="dateTable"></table>
</div>
<script type="text/html" id="barOption">
    <a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="upload">风险跟踪管理登记</a>
</script>
#end

#define js()
<script type="text/javascript">
    var projectFileTypeID = 0;

    layui.use(['table', 'layer'], function () {
        var table = layui.table,
            layer = layui.layer,
            $ = layui.jquery;

        var tableIns = table.render({
            elem: '#dateTable'                  //指定原始表格元素选择器（推荐id选择器）
            , id: 'dateTable'
            , even: true //开启隔行背景
            , size: 'sm' //小尺寸的表格
            , height: 'full-150'    //容器高度
            , contentType: 'application/json; charset=UTF-8'
            , cols: [[                 //标题栏
                {field: '0', align: 'center', width: 50, type: 'numbers', unresize: 'true'}
                , {field: 'name', title: '文件名', minWidth: 300, align: 'center', sort: true}
                , {field: 'createUserName', title: '上传人员', minWidth: 150, align: 'center', sort: true}
                , {field: 'createTime', title: '上传时间', minWidth: 150, align: 'center', sort: true}
                , {field: 'option', title: '操作', align: 'center', minWidth: 150, toolbar: '#barOption'} //这里的toolbar值是模板元素的选择器
            ]]
            , url: '#(ctxPath)/app/project/checkedTable?projectFileTypeID=' + projectFileTypeID
            , method: 'get'
            , request: {
                pageName: 'pageNumber' //页码的参数名称，默认：page
                , limitName: 'pageSize' //每页数据量的参数名，默认：limit
            }
            , page: true
            , limits: [30, 60, 90, 150, 300]
            , limit: 30 //默认采用30
            , loading: true
            , done: function (res, curr, count) {

                $('.layui-table-body').find('td').each(function (index, element) {
                    if ($(this).attr("data-field") > 0) {
                        $(this).css("display", "none");
                    }
                });
            }
        });

        table.on('tool(dateTable)', function (obj) {
            var data = obj.data;
            if (obj.event === 'upload') {
                window.location.href = '#(ctxPath)/app/track/toRiskTrackManagement?projectID=' + data.id;
            }
        });

    });
</script>
#end